//
//  ScanViewController.m
//  WuJieLive
//
//  Created by 张瀚坤 on 2017/10/23.
//  Copyright © 2017年 zhk. All rights reserved.
//

#import "ScanViewController.h"

@interface ScanViewController ()


@end

@implementation ScanViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.cameraInvokeMsg = @"相机启动中";
    
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self setNavi];
}

- (void)setNavi
{
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:self.leftBtn];
    [self.navigationController.navigationBar setBarTintColor:[UIColor whiteColor]];
}

#pragma mark -实现类继承该方法，作出对应处理

- (void)scanResultWithArray:(NSArray<LBXScanResult*>*)array
{
    
    LBXScanResult *scanResult = array[0];
    
    NSString*strResult = scanResult.strScanned;
    
    self.scanImage = scanResult.imgScanned;
    
   
    NSLog(@"%@",strResult);
}

-(UIButton *)leftBtn
{
    if (!_leftBtn) {
        _leftBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _leftBtn.frame = CGRectMake(0, 0, 44, 44);
        _leftBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
        _leftBtn.backgroundColor = [UIColor clearColor];
        [_leftBtn setImage:[[UIImage imageNamed:@"icon_nav_返回"] imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)] forState:(UIControlStateNormal)];
        [_leftBtn addTarget:self action:@selector(leftBtnAction:) forControlEvents:(UIControlEventTouchUpInside)];
    }
    return _leftBtn;
}

- (void)leftBtnAction:(UIButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
